<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:p="http://primefaces.prime.com.tr/ui">

    <body>

        <ui:composition template="./template.xhtml">

            <ui:define name="title">
                Gửi SMS trực tiếp
            </ui:define>

            <ui:define name="content">
                <h:form>
                    <h:panelGrid columns="2">
                        <p:panel >
                            <h:panelGrid columns="2">
                                Số gửi đi* 
                                <p:inputTextarea value="#{broadcastInstantBean.msisdn}"
                                                 required="true" requiredMessage="Bạn chưa nhập số gửi đi"/>
                                Đầu số* 
                                <p:selectOneMenu value="#{broadcastInstantBean.shortCode}">
                                    <f:selectItem itemLabel="6771" itemValue="6771"/>
                                    <f:selectItem itemLabel="6671" itemValue="6671"/>
                                    <f:selectItem itemLabel="6571" itemValue="6571"/>
                                    <f:selectItem itemLabel="6471" itemValue="6471"/>
                                    <f:selectItem itemLabel="6371" itemValue="6371"/>
                                    <f:selectItem itemLabel="6271" itemValue="6271"/>
                                    <f:selectItem itemLabel="6171" itemValue="6271"/>
                                    <f:selectItem itemLabel="6071" itemValue="6071"/>
                                </p:selectOneMenu>
                                Nội dung tin nhắn* 
                                <p:inputTextarea value="#{broadcastInstantBean.content}" onkeyup="countContentChar(this, 'contentCharCnt')"
                                                 required="true" requiredMessage="Bạn chưa nhập nội dung tin nhắn"/>
                                <h:outputText/>
                                <span id="contentCharCnt"></span>
                                <p:commandButton ajax="false" value="Gửi tin" action="#{broadcastInstantBean.sendMultiSms()}"
                                                 oncomplete="processingDialog.hide()"
                                                 onclick="processingDialog.show()"/>
                            </h:panelGrid>
                        </p:panel>

                    </h:panelGrid>
                </h:form>
            </ui:define>

        </ui:composition>

    </body>
</html>
